Diagnosis and correction of hearing impairment